﻿@page
@{ Layout = "_Layout"; }

<template>
    <div style="padding:0 11px;">
        <div>
            <el-form v-on:submit.native.prevent :inline="true" :size="euiSize">
                <el-form-item label="关键字">
                    <el-input v-model="formMark.keywords" placeholder="组织、用户名、姓名" prefix-icon="el-icon-search" clearable></el-input>
                </el-form-item>
                <el-form-item label="交卷时间：从">
                    <el-date-picker v-model="formMark.dateFrom"
                                    type="datetime"
                                    value-format="yyyy-MM-dd HH:mm:ss"
                                    placeholder="选择开始日期">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="到">
                    <el-date-picker v-model="formMark.dateTo"
                                    type="datetime"
                                    value-format="yyyy-MM-dd HH:mm:ss"
                                    placeholder="选择结束日期">
                    </el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-button :size="euiSize" icon="el-icon-search" type="primary" v-on:click="btnMarkSearchClick">查 询</el-button>
                    <el-button icon="el-icon-user" :size="euiSize" plain type="primary" v-on:click="btnMarkerArrange">安排阅卷老师</el-button>
                </el-form-item>
            </el-form>
        </div>
        <div>
            <el-table ref="markTable" :data="markList" :size="euiSize" v-on:selection-change="markHandleSelectionChange"
                      style="width: 100%">
                <el-table-column type="selection" align="left"
                                 width="28">
                </el-table-column>
                <el-table-column label="#"
                                 type="index"
                                 width="60"
                                 align="left">
                    <template scope="scope">
                        <span>{{(formMark.pageIndex - 1) * formMark.pageSize + scope.$index + 1}}</span>
                    </template>
                </el-table-column>
                <el-table-column label="账号">
                    <template slot-scope="scope">
                        <el-link :underline="false" type="primary" v-on:click="btnViewClick(scope.row.user.id)">{{scope.row.user.userName}}</el-link>
                    </template>
                </el-table-column>
                <el-table-column prop="user.displayName" label="姓名">
                </el-table-column>
                <el-table-column prop="user.organNames" label="组织" show-overflow-toolti>
                </el-table-column>
                <el-table-column label="开考时间" prop="beginDateTime" width="150">
                </el-table-column>
                <el-table-column label="交卷时间" prop="endDateTime" width="150">
                </el-table-column>
                <el-table-column prop="user.useTime" label="用时" width="100">
                </el-table-column>
                <el-table-column label="阅卷人">
                    <template slot-scope="scope">
                        <el-link :underline="false" type="primary" v-on:click="btnAdminViewClick(scope.row.markTeacherId)" v-if="scope.row.markTeacherId>0">{{scope.row.marker}}</el-link>
                        <span v-else>/</span>
                    </template>
                </el-table-column>
                <el-table-column width="100" align="right">
                    <template slot-scope="scope">
                        <el-button size="mini" type="primary" plain v-on:click.native="btnPaperMarkView(scope.row.id)" icon="el-icon-edit">阅 卷</el-button>
                    </template>
                </el-table-column>
                @await Html.PartialAsync("_PartialTableEmpty")
            </el-table>

            <div style="text-align: center; margin-top: 10px;">
                <el-pagination v-on:current-change="markHandleCurrentChange" background
                               :current-page="formMark.pageIndex"
                               :page-size="formMark.pageSize"
                               layout="total, prev, pager, next"
                               :total="markTotal">
                </el-pagination>
            </div>
        </div>
    </div>
</template>
<template>
    <el-dialog title="安排阅卷人" :visible.sync="markerSelectDialogVisible">
        <el-form ref="markerForm" :model="markerForm" :inline="true">
            <el-form-item label="阅卷老师" prop="id" :rules="{ required: true, message: '请选择考阅卷老师' }">
                <el-select v-model="markerForm.id" placeholder="请选择" clearable filterable>
                    <el-option v-for="item in markerList"
                               :key="item.id"
                               :label="item.displayName"
                               :value="item.id">
                        <span style="float: left">{{ item.displayName }}</span>
                        <span style="float: right; color: #8492a6; font-size: 13px">{{ item.userName }}</span>
                    </el-option>
                </el-select>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button icon="el-icon-check" type="primary" v-on:click="btnMarkerArrangeSubmit">确 定</el-button>
            <el-button icon="el-icon-close" v-on:click="markerSelectDialogVisible = false">取 消</el-button>
        </div>
    </el-dialog>
</template>
@section Scripts{
    <script src="/sitefiles/assets/js/admin/exam/examPaperManagerMark.js" type="text/javascript"></script>
}